close all;
clear all;
clc;
% t=[0:pi/100:2*pi];
% y=1/2*(1+(cos(t)).^2);
% plot(t,y);
x=[-0.00000000001:0.0000000000001:0.00000000001];
y=[-0.00000000001:0.0000000000001:0.00000000001];
[m,n]=size(x);
for(j=1:1:n)
    for(k=1:1:n)
        im(j,k)=1/2*(x(1,j)^2+2*y(1,k)^2)/((x(1,j)^2+y(1,k)^2)^2);
    end
end
% im=im/(max(max(im)))*255;
figure;
imagesc(im);
h=colorbar('vert');
figure;
% z=1/2*(x.^2+2*y.^2)./(x.^2+y.^2);
% figure;
mesh(x,y,im);

for(G=3:1:300)
X=[-G:1:G];
Y=sqrt(G^2-X.^2);
Ybar=-sqrt(G^2-X.^2);
% [M,N]=size(X);
% for(h=1:1:N)
%     for(b=1:1:N)
%         Z(h,b)=1/2*(300^2+Y(1,b)^2)/(300^2)^2;
%     end
% end
Z=1/2*(G^2+Y.^2)./(G^2)^2;
% figure;
plot3(X,Y,Z);
hold on;
plot3(X,Ybar,Z);
hold on;
end



